import {HTTP} from '@/utils/HTTP.js'
import {useState, useEffect} from "react";

// 异步请求频道数据
const useSwiper = () => {
    const [swiperList, setSwiperList] = useState([])

    // console.log(res)
    useEffect(() => {

        async function getSwiperList() {
            const res = await HTTP({
                url: '/api/swiper',
                method: 'GET'
            })
            setSwiperList(res.data)
        }
        getSwiperList()

    }, [])

    return {swiperList}
}

export default useSwiper